package com.jxk.aotoconfig;

/**
 * @ClassName : config  //类名
 * @Description :   //描述
 * @Author : jxk  //作者
 * @Date: 2020-09-22 10:17  //时间
 */

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @ConfigurationProperties
 * 自动匹配application.properties文件中hello.msg的值，
 * 然后赋值给类属性msg，这里的msg默认值为“spring boot”
 *
 */
@Component
@ConfigurationProperties(prefix="hello")
public class HelloServiceProperties {

    private static final String MSG = "spring boot";

    private String msg = MSG;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


}